#!/bin/bash -e

function info() {
echo Usage: `basename $0` [-m] sample panel result_dir_or_file raw_data
exit 65
}

while getopts  ":s:p:t:m" opts
do
        case  $opts  in
        s) sample_name=$OPTARG;;
		p) out_prefix=$OPTARG;;
		m) mail_to_me=true;;
		*) info;;
        esac
done
shift $(($OPTIND - 1))



if [ $# -lt 1 ]; then info; fi


. /mnt/ilustre/app/medical/tools/.var

me=`whoami|tr a-z A-Z`

sample_name=`echo $1|tr a-z A-Z`

# http='http://192.168.10.113:8000'


echo -e "

<p>DEAR :)</p>

<p>A SNP or CNV analysis is done, below is a snapshot.</p>

<p>Sample: $sample_name</p>

<p>Raw data: $4\t$5</p>

<p>Panel: $2</p>

<p>Results: please <a href=\"$http/$3\">visit and check</a> via MAJORBIO's area network.</p>

<p>Best</p>

<p>$me</p>

"|mutt -e'set content_type="text/html"' -s"Analysis report" -c jing.li@majorbio.com changyue.chen@majorbio.com

if test -n "$mail_to_me"; then

echo -e "

<p>DEAR :)</p>

<p>A SNP or CNV analysis is done, below is a snapshot.</p>

<p>Sample: $sample_name</p>

<p>Raw data: $4\t$5</p>

<p>Panel: $2</p>

<p>Results: please <a href=\"$http/$3\">visit and check</a> via MAJORBIO's area network.</p>

<p>Best</p>

<p>$me</p>

"|mutt -e'set content_type="text/html"' -s"Analysis report" `whoami`@majorbio.com

fi

# jing.li@majorbio.com changyue.chen@majorbio.com

. $cmd_done